package com.milkTeaServer.dao;

import com.milkTeaServer.bean.Cart;
import com.milkTeaServer.bean.Comment;
import com.milkTeaServer.bean.MilkTea;
import com.milkTeaServer.bean.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;
@Transactional
@Repository
public interface MilkTeaDao extends JpaRepository<MilkTea,Integer> {
    @Query(value="select id, name, price,img,sales from t_milk_tea where id = ?1 order by id desc",
            nativeQuery=true )
    List<MilkTea> findTeaById(Integer id);
}
